/**
 * 音频评论
 * @author luguoxiang
 * @date 2025-02-23
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
import { IConfigSchema } from '@/soar';
import { basePath } from './api';
import { MenuComponent } from '@/types/interface';

export interface AudioComment {
  /** 文章id */
  audioId?: any;
  /** 评论内容 */
  content?: any;
  /**  */
  id?: any;
  /** 点赞数 */
  likes?: any;
  /** 回复评论id（顶级0） */
  parentId?: any;
  /** 评论时间 */
  time?: any;
  /** 用户id */
  userId?: any;
}

const fieldList: IConfigSchema<AudioComment>[] = [
  {
    field: 'audioId',
    label: '音频id',
    dataType: 'number',
  },
  {
    field: 'content',
    label: '评论内容',
    dataType: 'string',
  },
  {
    field: 'likes',
    label: '点赞数',
    dataType: 'number',
  },
  {
    field: 'parentId',
    label: '回复评论id（顶级0）',
    dataType: 'number',
  },
  {
    field: 'time',
    label: '评论时间',
    dataType: 'datetime',
  },
  {
    field: 'userId',
    label: '用户id',
    dataType: 'number',
  },
];

export default fieldList;

/**
 * 组件配置（用于生成菜单数据）
 */
export const COMPONENTS: MenuComponent[] = [
  {
    title: '音频评论',
    component: () => import('./List.vue'),
    sort: 20,
    keepalive: true,
    icon: 'root-list',
    permits: [`GET${basePath}/query`],
    elements: [
      { title: '新增', code: 'create', permits: [`POST${basePath}/create`] },
      { title: '更新', code: 'update', permits: [`POST${basePath}/update`, `GET${basePath}/detail`] },
      { title: '删除', code: 'remove', permits: [`POST${basePath}/remove`] },
      { title: '详情', code: 'detail', permits: [`GET${basePath}/detail`] },
      { title: '导入', code: 'import', permits: [`POST${basePath}/import`] },
      { title: '导出', code: 'export', permits: [`GET${basePath}/export`] },
    ],
  },
];
